Hello void setFiltering(){ Module m; string attName = get (choiceFrom); // obtains both choiceFrom and choiceWhat from a choice() dialog box. string prodName = get(choiceWhat); AttrDef ad = null; AttrType selAttr = null; int i; Filter f = null; delete editList; editList = create; bool isFiltered = false; int pocet = 0; _Filter reqstatus = attribute VALUE_ATTR_NAME!= "Obsolete"_ // Added by me for m in moduleList do { current = m; pocet++; int attSize; ad = find(m,attName); selAttr = find (m, VALUE_ATTRIBUTE_NAME); if (!null ad){ Filter f2 = includes (attribute attName,prodName) f = reqstatus && f2; Running the above always backtraced to the setfiltering() call function; and as it had worked fine earlier, it was a problem with the small addition I made. So I replaced the above filter "reqstatus" definition with the following: Filter reqstatus = excludes(attribute VALUE_ATTR_NAME, "Obsolete") This did not crash DOORS but still doesn't work with this error: attribute must be multi valued Also, the attribute VALUE_ATTR_NAME(which is a string variable), is a single-valued attribute with 4values. I also find it strange that only for few modules it doesn't work and I have no clue what other functions can be used for this. I'm only few months old at DXL scripting, and need a resolution soon. Please advise. Thanks! SystemAdmin - Thu Nov 08 03:10:26 EST 2012 |
Re: DXL script using filter crashes
Hi,
AttrDef myAd = find(m, VALUE_ATTR_NAME)
Filter reqstatus = null
if (myAd.multi) {
reqstatus = excludes(attribute VALUE_ATTR_NAME, "Obsolete")
}
else {
reqstatus = attribute VALUE_ATTR_NAME != "Obsolete"
}
|
Re: DXL script using filter crashes Johnny_P - Thu Nov 08 03:36:15 EST 2012
Hi,
AttrDef myAd = find(m, VALUE_ATTR_NAME)
Filter reqstatus = null
if (myAd.multi) {
reqstatus = excludes(attribute VALUE_ATTR_NAME, "Obsolete")
}
else {
reqstatus = attribute VALUE_ATTR_NAME != "Obsolete"
}
Thanks a lot for that explanation. That explains the ambiguous results I was getting. And that script snippet solves the issue too :) --Sindhu |
Re: DXL script using filter crashes
-Louie |